﻿<%@ Control Language="C#" AutoEventWireup="true" CodeFile="ControlNhapChiPhiHangNgay.ascx.cs" Inherits="UserControl_ControlNhapChiPhiHangNgay" %>
<%@ Import Namespace="webapp4U" %>
 <%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %>

<%@ Register assembly="DevExpress.Web.v9.2, Version=9.2.6.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" namespace="DevExpress.Web.ASPxPopupControl" tagprefix="dxpc" %>


<script type="text/javascript">
    function pageLoad() {
        //bắt buộc nhập kiểu số
        $("#<%= txtTongTien.ClientID %>").numeric({ allow: "." });


       // var startdate="21/04/2012";

        //Lấy ngày workingday
        $.ajax({
            type: "POST",
            url: '<%=ResolveUrl("~/Webservice/WebServiceDRM.asmx/GetWorkingDay")%>',
            data: "{}",
            contentType: "application/json; charset=utf-8",
            dataType: "json",
            success: function (data) {
                $("#<%= txtNgayHoaDon.ClientID %>").datePicker(
		            {
		                clickInput: true,
		                startDate: data.d
		            });
            }
        });



        $("#<%= btnDelete.ClientID %>").click(function() {
            $.blockUI({ css: {
                border: 'none',
                padding: '15px',
                backgroundColor: '#000',
                '-webkit-border-radius': '10px',
                '-moz-border-radius': '10px',
                opacity: .5,
                color: '#fff'
            }
            });
        });

        $("#<%= imgBtnAdd.ClientID %>").click(function () {
            $.blockUI({ css: {
                border: 'none',
                padding: '15px',
                backgroundColor: '#000',
                '-webkit-border-radius': '10px',
                '-moz-border-radius': '10px',
                opacity: .5,
                color: '#fff'
            }
            });
        });
        $("#<%= btnSave.ClientID %>").click(function () {
            if ($("#<%= txtTongTien.ClientID %>").val().length > 0) {
                $.blockUI({ css: {
                    border: 'none',
                    padding: '15px',
                    backgroundColor: '#000',
                    '-webkit-border-radius': '10px',
                    '-moz-border-radius': '10px',
                    opacity: .5,
                    color: '#fff'
                }
                });
            }
        });
        
        $("#<%= btSearch.ClientID %>").click(function () {
            $.blockUI({ css: {
                border: 'none',
                padding: '15px',
                backgroundColor: '#000',
                '-webkit-border-radius': '10px',
                '-moz-border-radius': '10px',
                opacity: .5,
                color: '#fff'
            }
            });
        });

        Sys.WebForms.PageRequestManager.getInstance().add_endRequest(EndRequestHandler);
        function EndRequestHandler(sender, args) {
            $.unblockUI();
        }
    }

</script>


<asp:UpdatePanel ID="UpdatePanel1" runat="server">
    <ContentTemplate>
     <div class="direct_container_right_titletop">
                     Nhập chi phí hàng ngày
                </div>
                 <hr />
                <!-- Button chuc nang-->
                <div class="direct_container_main">
                    <asp:ImageButton ID="imgBtnAdd" onclick="imgBtnAdd_Click" CausesValidation="false" ImageUrl="~/Images/add.png" Width="32px" Height="32px" runat="server" />
                    <%--<asp:ImageButton ID="imgBtnSave" onclick="imgBtnSave_Click" ImageUrl="~/Images/save.png" Width="32px" Height="32px" runat="server" />
                    <asp:ImageButton ID="imgBtnDelete" onclick="imgBtnDelete_Click" ImageUrl="~/Images/delete.png" Width="32px" Height="32px" runat="server" />
                    <asp:ImageButton ID="imgBtnFind" onclick="imgBtnFind_Click" CausesValidation="false" ImageUrl="~/Images/find.png" Width="32px" Height="32px" runat="server" />--%>

                </div>
                <!-- End Button chuc nang-->
                <cc1:TabContainer ID="TabContainer1" runat="server" ActiveTabIndex="0" 
            BackColor="#CCFFFF" Font-Names="Arial"  Height="700px" 
            Width="100%">
            <cc1:TabPanel ID="TabPanel1" runat="server" HeaderText="Nhập thông tin" TabIndex="0">
                 <ContentTemplate>
                         <!-- Content main-->
                <div class="direct_container_main">
                    <div class="direct_container_form_right">
                        <table border="0" width="100%">
                        <tr>
                            <td colspan="4" align="center">
                                <asp:Label ID="lblMsg" runat="server" Visible="false" BackColor="Silver" ForeColor="Blue" Font-Bold="true" Font-Italic="true"></asp:Label>
                            </td>
                        </tr>
                        
                        <tr>
                            <td width="12%" align="right"><p class="direct_label">Số hóa đơn</p></td>
                            <td width="88%" align="left">
                           
                                <asp:TextBox ID="txtSoHoaDon" ReadOnly="True" CssClass="input_code" 
                                    runat="server"></asp:TextBox>
                            </td>
                        </tr>
                        <tr>
                            <td align="right"><p class="direct_label">Ngày hóa đơn</p></td>
                            <td align="left">
                            
                                <asp:TextBox ID="txtNgayHoaDon" CssClass="input_code" runat="server"></asp:TextBox>
                            </td>
                        </tr>
                        <tr>
                            <td align="right"><p class="direct_label">Loại chi phí</p></td>
                            <td align="left">
                                <asp:DropDownList AutoPostBack="True" ID="DropTypeChiPhi" runat="server" 
                                    onselectedindexchanged="DropTypeChiPhi_SelectedIndexChanged">
                                </asp:DropDownList>
                            </td>
                            
                        </tr>
                        
                         <tr>
                            <td align="right"><p class="direct_label">Chi phí</p></td>
                                <td align="left">
                                  <asp:DropDownList ID="DropChiPhi" runat="server">
                                </asp:DropDownList>
                                </td>

                               
                        </tr>
            
              
                           <tr>
                            <td align="right"><p class="direct_label">Tổng tiền</p></td>
                            <td align="left">
                            
                                <asp:TextBox ID="txtTongTien"  CssClass="input_code" runat="server"></asp:TextBox>
                               
                            </td>
                        </tr> 
                        <tr>
                            <td align="right"><p class="direct_label">Ghi chú</p></td>
                            <td align="left">
                            
                                <asp:TextBox ID="txtGhiChu" TextMode="MultiLine" Height="100px" Width="300px" runat="server"></asp:TextBox>
                                
                                <asp:Button ID="btnSave" runat="server" Text="Lưu" onclick="btnSave_Click"/>
                                <asp:Button ID="btnDelete" runat="server" Text="Xóa" onclick="btnDelete_Click"/>
                            </td>
                        </tr>                         
                                                       
                    </table>
                   
                    </div>
                </div>
                 </ContentTemplate>
            </cc1:TabPanel>
             <cc1:TabPanel ID="TabPanel2" runat="server" HeaderText="Tìm kiếm" TabIndex="1">
                <ContentTemplate>
                         <div class="direct_container_main">
                                <div class="direct_container_form_right">
                                        <table border="0" width="100%">
                                <tr><td><p class="direct_legend">Nhập thông tin cần tìm</p></td></tr>
                                <tr>
                                    <td valign="middle">
                                       
                                        <asp:TextBox ID="txtSearch" CssClass="input_full" runat="server"></asp:TextBox>
                                        <asp:Button ID="btSearch" CssClass="direct_bt_search" runat="server" CausesValidation="False"
                                            Text="Tìm kiếm" onclick="btSearch_Click" />
                                    </td>

                                </tr>
                                            <tr>
                                                <td>
                                                    <asp:GridView ID="grvMonthLyExpense" PageSize="10"
                                                     runat="server" AutoGenerateColumns="False" 
                                                        DataKeyNames="ID" EnableModelValidation="True" AllowPaging="True" 
                                                        onpageindexchanging="grvMonthLyExpense_PageIndexChanging1"
                                                         onrowcommand="grvMonthLyExpense_RowCommand1"
                                                        >
                                                        <Columns>
                                                            <asp:TemplateField HeaderText="Stt">
                                                                <HeaderTemplate>
                                                                    STT
                                                                </HeaderTemplate>
                                                                <ItemTemplate>
                                                                    <%# Container.DataItemIndex + 1 %>
                                                                </ItemTemplate>
                                                                <HeaderStyle HorizontalAlign="Left" Width="50px" />
                                                                <ItemStyle Height="40px" HorizontalAlign="Left" Width="50px" />
                                                            </asp:TemplateField>
                                                            <asp:TemplateField HeaderText="Mã chi phí">
                                                                <HeaderTemplate>
                                                                    Mã hóa đơn
                                                                </HeaderTemplate>
                                                                <ItemTemplate>
                                                                <asp:Label ID="lblMaSo" runat="server" Text='<%# Eval("ID")%>'></asp:Label>
                                                                   
                                                                </ItemTemplate>
                                                                <HeaderStyle HorizontalAlign="Left" Width="150px" />
                                                                <ItemStyle Height="40px" HorizontalAlign="Left" Width="150px" />
                                                            </asp:TemplateField>
                                                            <asp:TemplateField HeaderText="Tên loại chi phí">
                                                                <HeaderTemplate>
                                                                    Tên loại chi phí
                                                                </HeaderTemplate>
                                                                <ItemTemplate>
                                                                  <%# Eval("ExpTypeDesc")%>
                                                                   
                                                                </ItemTemplate>
                                                                <HeaderStyle HorizontalAlign="Left" Width="200px" />
                                                                <ItemStyle Height="40px" HorizontalAlign="Left" Width="200px" />
                                                            </asp:TemplateField>
                                                             <asp:TemplateField HeaderText="Tên chi phí">
                                                                <HeaderTemplate>
                                                                    Tên chi phí
                                                                </HeaderTemplate>
                                                                <ItemTemplate>
                                                                  
                                                                    <%# Eval("ExpDesc")%>
                                                                </ItemTemplate>
                                                                <HeaderStyle HorizontalAlign="Left" Width="200px" />
                                                                <ItemStyle Height="40px" HorizontalAlign="Left" Width="200px" />
                                                            </asp:TemplateField>
                                                            <asp:TemplateField HeaderText="Tổng tiền">
                                                                <HeaderTemplate>
                                                                    Tổng tiền
                                                                </HeaderTemplate>
                                                                <ItemTemplate>
                                                                  
                                                                  <%# Eval("ExpVal", "{0:###,###}")%>
                                                                   
                                                                </ItemTemplate>
                                                                <HeaderStyle HorizontalAlign="Left" Width="150px" />
                                                                <ItemStyle Height="40px" HorizontalAlign="Left" Width="150px" />
                                                            </asp:TemplateField>
                                                            
                                                            <asp:TemplateField HeaderText="Ngày phát sinh">
                                                                <HeaderTemplate>
                                                                    Ngày phát sinh
                                                                </HeaderTemplate>
                                                                <ItemTemplate>
                                                                  
                                                                  <%# Eval("ExpYyyyMmDd")%>
                                                                   
                                                                </ItemTemplate>
                                                                <HeaderStyle HorizontalAlign="Left" Width="150px" />
                                                                <ItemStyle Height="40px" HorizontalAlign="Left" Width="150px" />
                                                            </asp:TemplateField>
                                                             <asp:TemplateField HeaderText="Ghi chú">
                                                                <HeaderTemplate>
                                                                    Ghi chú
                                                                </HeaderTemplate>
                                                                <ItemTemplate>
                                                                  
                                                                  <%# Eval("CashRevNote")%>
                                                                   
                                                                </ItemTemplate>
                                                                <HeaderStyle HorizontalAlign="Left" Width="200px" />
                                                                <ItemStyle Height="40px" HorizontalAlign="Left" Width="200px" />
                                                            </asp:TemplateField>
                                                             <asp:TemplateField>
                                                                 <ItemTemplate>
                                                                    <asp:ImageButton ID="imgBtnChon" runat="server" CausesValidation="False" 
                                                                    CommandName="chon" Height="25px" Width="25px" ImageUrl="~/Images/check.png" />
                                                                </ItemTemplate>
                                                                <ControlStyle BackColor="White" BorderColor="White" />
                                                                <FooterStyle BackColor="White" BorderColor="White" />
                                                                <HeaderStyle BackColor="White" BorderColor="White" />
                                                                <ItemStyle BackColor="White" BorderColor="White" />
                                                            </asp:TemplateField>
                                                        </Columns>
                                                    </asp:GridView>
                                                </td>
                                            </tr>
                                
                         </table>
                                </div>

                           </div>
                </ContentTemplate>
            </cc1:TabPanel>
            </cc1:TabContainer>
            <dxpc:ASPxPopupControl ID="MessageBox" PopupHorizontalAlign="WindowCenter"  PopupVerticalAlign="WindowCenter" Font-Bold="true" HeaderText="DRM-S" runat="server" Height="91px" 
        Width="601px">
        <ContentCollection>
<dxpc:PopupControlContentControl ID="PopupControlContentControl1" runat="server" SupportsDisabledAttribute="True"></dxpc:PopupControlContentControl>
</ContentCollection>
    </dxpc:ASPxPopupControl>
    </ContentTemplate>
</asp:UpdatePanel>

